package com.ruoyi.culture.service;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.ruoyi.culture.domain.CultureMeet;
import com.ruoyi.culture.mapper.CultureMeetMapper;
import org.apache.xmlbeans.impl.xb.xsdschema.Public;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class CultureMeetService {

    private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();

    @Autowired
    CultureMeetMapper cultureMeetMapper;

    public void insert(CultureMeet cultureMeet){
        int result = cultureMeetMapper.addOne(cultureMeet);
        if (result==0){
            throw new RuntimeException("新增文化会议信息失败");
        }
    }


    public List<CultureMeet> getList(String title, Date beginningDate,Date endingDate) {
        return cultureMeetMapper.getList(title,beginningDate,endingDate);
    }
}
